package cn.xm.lingshi.dao;

import java.util.List;

import cn.xm.lingshi.pojo.Brand;
import cn.xm.lingshi.pojo.Kind;
import cn.xm.lingshi.pojo.Shop;
import cn.xm.lingshi.pojo.Type;

/**
 * 零食数据接口
 * @author 魏魁
 *
 */
public interface ShopDao {
	/**
	 * 取得销量前五的商品
	 * @return
	 */
	public List<Shop> getShopBySalesTop5() throws Exception;
	/**
	 * 获取零食类型
	 * @return
	 * @throws Exception
	 */
	public List<Type> getType() throws Exception; 
	/**
	 * 根据零食类型获取零食种类
	 * @param typeId
	 * @return
	 * @throws Exception
	 */
	public List<Kind> getKindByTypeId(int typeId) throws Exception;
	/**
	 * 添加商品
	 * @param shop
	 * @return
	 * @throws Exception
	 */
	public int addShop(Shop shop) throws Exception;
	/**
	 * 获取零食品牌
	 * @return
	 * @throws Exception
	 */
	public List<Brand> getBrand() throws Exception;
	/**
	 * 添加商品口味
	 * @return
	 * @throws Exception
	 */
	public int addShopFlavour(int flavid,int shopid) throws Exception;
	/**
	 * 根据零食名称获取零食编号
	 * @return
	 * @throws Exception
	 */
	public int getShop(String Shopname) throws Exception;
	/**
	 * 获取最新上架的商品
	 * @return
	 * @throws Exception
	 */
	public List<Shop> getShopByTime() throws Exception;
	/**
	 * 查询新闻的总记录数
	 * @return
	 * @throws Exception
	 */
	public int queryTotalRecord(String searchTitle,int searchTId) throws Exception;
	/**
	 * 分页查询
	 * @param offSet 偏移量
	 * @param pageSize 每页的记录数
	 * @return
	 * @throws Exception
	 */
	public List<Shop> queryNewsByOffset(int offSet,int pageSize,String searchTitle,int searchTId) throws Exception;
}
